package com.csii.mobilebanking.user;

import android.content.Context;
import android.view.View;
import android.view.inputmethod.InputMethodManager;

public class InputUtil {
	private Context mContext;

	InputUtil(Context context) {
		this.mContext = context;
	}

	protected void chkInputState(View v) {
		InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
		boolean isOpen = imm.isActive();
		if (isOpen) {
			// 关闭输入法
			imm.hideSoftInputFromWindow(v.getWindowToken(),// 空指针 -得不到焦点
					InputMethodManager.HIDE_NOT_ALWAYS);
		}

	}

}
